import React from 'react';
import { Card, Empty } from 'antd';
import withCustomClass from '@/utils/marketingMap/withCustomClass';
// Empty

const WithCard = ({ empty, ...other }: any) => {
  if (empty)
    return (
      <Card {...other}>
        <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
      </Card>
    );

  return (
    <Card {...other}>
      <div
        style={{
          display: 'flex',
          justifyContent: 'center',
        }}
      >
        {other.children}
      </div>
    </Card>
  );
};

const CustomCard = withCustomClass(WithCard, '', {
  headStyle: {
    background: '#fafafa',
    textAlign: 'left',
  },
  bodyStyle: {
    paddingLeft: 12,
    paddingRight: 12,
  },
  size: 'small',
});

export default CustomCard;
